Code: Change Tone according to light

/* circuit: * 8-ohm speaker on digital pin 8 * photoresistor on analog 0 to 5V * 4.7K resistor on analog 0 to ground created 21 Jan 2010 by Tom Igoe This example code is in the public domain. http://arduino.cc/en/Tutorial/Tone2 */void setup() { Serial.begin(9600);}void loop() { int sensorReading = analogRead(0); Serial.println(sensorReading); int thisPitch = map(sensorReading, … Continue reading Code: Change Tone according to light